import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.set_xlabel('X') 
ax.set_xlim(0, 40) 
ax.set_ylabel('Y') 
ax.set_ylim(0, 40) 
ax.set_zlabel('Z') 
ax.set_zlim(0, 40) 


X=[10,10,20]
Y=[10,10,10]
Z=[0,20,20]
X=np.array(X)
Y=np.array(Y)
Z=np.array(Z)

ax.scatter(X[0], Y[0], Z[0], c='c') #画点 三维中
ax.scatter(X[1], Y[1], Z[1], c='r') #画点 三维中
ax.scatter(X[2], Y[2], Z[2], c='b') #画点 三维中
ax.plot(X, Y, Z)
#----------------------------------------------------
# X1=X + 10
# Y1=Y - 10
# Z1=Z
# ax.scatter(X1[0], Y1[0], Z1[0], c='c') #画点 三维中
# ax.scatter(X1[1], Y1[1], Z1[1], c='r') #画点 三维中
# ax.scatter(X1[2], Y1[2], Z1[2], c='b') #画点 三维中
# ax.plot(X1, Y1, Z1)

#---------------------------------------------------






plt.show()